<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8"/>
    <title>添加</title>
    <link href="__STATIC__/component/pear/css/pear.css" rel="stylesheet"/>
    {include file='public/head.html'}
</head>
<body class="childrenBody {:dialog_css()}">
<form class="layui-form" action="{:url('add')}" method="post">
    <div class="layui-form-item">
        <label class="layui-form-label layui-form-item-required">配置名称</label>
        <div class="layui-input-block">
            <input type="text" name="title" lay-verify="required" placeholder="配置名称" value="" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label layui-form-item-required">备注</label>
        <div class="layui-input-block">
            <input type="text" name="memo" lay-verify="required" placeholder="备注说明" value="" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label layui-form-item-required">所属应用</label>
        <div class="layui-input-block">
            {:form_select('app', site('app_list', 'common=公共|index=前台|admin=后台'), 'admin')}
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label layui-form-item-required">文件标识</label>
        <div class="layui-input-block">
            <input type="text" name="sign" lay-verify="required" placeholder="文件标识" value="" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">隐藏</label>
        <div class="layui-input-block">
            <input type="hidden" name="is_hide" value="0">
            <input type="checkbox" name="is_hide" value="1" lay-skin="switch" lay-text="是|否">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">禁删</label>
        <div class="layui-input-block">
            <input type="hidden" name="is_sys" value="0">
            <input type="checkbox" name="is_sys" value="1" lay-skin="switch" lay-text="是|否">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">排序</label>
        <div class="layui-input-block">
            <input type="number" name="sort" value="100" min="0" step="10" lay-affix="number" placeholder="请输入排序值" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item layer-footer">
        <div class="layui-input-block">
            <button type="submit" class="layui-btn layui-btn-normal layui-btn-sm" lay-submit="" lay-filter="save">
                <i class="layui-icon layui-icon-ok"></i>
                添加
            </button>
            <button type="reset" class="layui-btn layui-btn-primary layui-btn-sm">
                <i class="layui-icon layui-icon-refresh"></i>
                重置
            </button>
        </div>
    </div>
</form>
<script src="__STATIC__/component/layui/layui.js"></script>
<script src="__STATIC__/component/pear/pear.js"></script>
<script>
    layui.use(['form', 'jquery', 'aphp'], function () {
        let form = layui.form;
        let $ = layui.jquery;
        let aphp = layui.aphp;
        form.on('submit(save)', function (data) {
            aphp.request.postForm(data, 0, function () {
                parent.layer.close(parent.layer.getFrameIndex(window.name));
                parent.layui.table.reload('currentTable');
            });
            return false;
        });
    })
</script>
</body>
</html>